<html>
<head><meta charset="utf-8"><title>Getting parent of an AST node? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Getting.20parent.20of.20an.20AST.20node.3F.html">Getting parent of an AST node?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="224602976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Getting%20parent%20of%20an%20AST%20node%3F/near/224602976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Getting.20parent.20of.20an.20AST.20node.3F.html#224602976">(Jan 30 2021 at 20:15)</a>:</h4>
<p>I checked the relevant types and I think the answer is no, but just to make sure.. given a <code>NodeId</code> for an AST node is there a way to get the parent node?</p>



<a name="224603148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Getting%20parent%20of%20an%20AST%20node%3F/near/224603148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Getting.20parent.20of.20an.20AST.20node.3F.html#224603148">(Jan 30 2021 at 20:19)</a>:</h4>
<p>I think only <code>HirId</code> lets you do that</p>



<a name="224603575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Getting%20parent%20of%20an%20AST%20node%3F/near/224603575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Getting.20parent.20of.20an.20AST.20node.3F.html#224603575">(Jan 30 2021 at 20:30)</a>:</h4>
<p>OK thanks</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>